/*
 * @(#)MaintMtmCalendarUserUserActorForm.java
 *
 * Copyright (c) 2003 DCIVision Ltd
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of DCIVision
 * Ltd ("Confidential Information").  You shall not disclose such Confidential
 * Information and shall use it only in accordance with the terms of the license
 * agreement you entered into with DCIVision Ltd.
 */
package com.dcivision.calendar.web;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionMapping;

import com.dcivision.calendar.bean.MtmCalendarUserUserActor;
import com.dcivision.framework.ApplicationException;
import com.dcivision.framework.TextUtility;
import com.dcivision.framework.bean.AbstractBaseObject;
import com.dcivision.framework.web.AbstractActionForm;

/**
  MaintMtmCalendarUserUserActorForm.java

  This class is the for web form purpose.

  @author      Tony Chen
  @company     DCIVision Limited
  @creation date   05/12/2003
  @version     $Revision: 1.4 $
*/

public class MaintMtmCalendarUserUserActorForm extends AbstractActionForm {

  public static final String REVISION = "$Revision: 1.4 $";

  private String userRecordID = null;
  private String actorType = null;
  private String actorID = null;

  //----------------add by Tony---------------
  private String[] shareToUserIDs = null;
  private String[] shareToUserRoles = null;
  private String[] shareToUserGroups = null;



  public MaintMtmCalendarUserUserActorForm() {
    super();
  }

  public String getUserRecordID() {
    return(this.userRecordID);
  }

  public void setUserRecordID(String userRecordID) {
    this.userRecordID = userRecordID;
  }

  public String getActorType() {
    return(this.actorType);
  }

  public void setActorType(String actorType) {
    this.actorType = actorType;
  }

  public String getActorID() {
    return(this.actorID);
  }

  public void setActorID(String actorID) {
    this.actorID = actorID;
  }

  public String[] getShareToUserIDs() {
      return this.shareToUserIDs;
  }

  public void setShareToUserIDs(String[] shareToUserIDs) {
      this.shareToUserIDs = shareToUserIDs;
  }

  public String[] getShareToUserRoles() {
      return this.shareToUserRoles;
  }

  public void setShareToUserRoles(String[]  shareToUserRoles) {
      this.shareToUserRoles = shareToUserRoles;
  }

  public String[] getShareToUserGroups() {
      return this.shareToUserGroups;
  }

  public void setShareToUserGroups(String[] shareToUserGroups) {
      this.shareToUserGroups = shareToUserGroups;
  }

  public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
    return super.validate(mapping, request);
  }

  public void reset(ActionMapping mapping, HttpServletRequest request) {
    super.reset(mapping, request);
    this.setID(null);
    this.setUserRecordID(null);
    this.setActorType(null);
    this.setActorID(null);
    this.setRecordStatus(null);
    this.setUpdateCount(null);
    this.setCreatorID(null);
    this.setCreateDate(null);
    this.setUpdaterID(null);
    this.setUpdateDate(null);
  }

  public AbstractBaseObject getFormData() throws ApplicationException {
    MtmCalendarUserUserActor tmpMtmCalendarUserUserActor = new MtmCalendarUserUserActor();
    tmpMtmCalendarUserUserActor.setID(TextUtility.parseIntegerObj(this.getID()));
    tmpMtmCalendarUserUserActor.setUserRecordID(TextUtility.parseIntegerObj(this.getUserRecordID()));
    tmpMtmCalendarUserUserActor.setActorType(this.getActorType());
    tmpMtmCalendarUserUserActor.setActorID(TextUtility.parseIntegerObj(this.getActorID()));
    tmpMtmCalendarUserUserActor.setRecordStatus(this.getRecordStatus());
    tmpMtmCalendarUserUserActor.setUpdateCount(TextUtility.parseIntegerObj(this.getUpdateCount()));
    tmpMtmCalendarUserUserActor.setCreatorID(TextUtility.parseIntegerObj(this.getCreatorID()));
    tmpMtmCalendarUserUserActor.setCreateDate(parseTimestamp(this.getCreateDate()));
    tmpMtmCalendarUserUserActor.setUpdaterID(TextUtility.parseIntegerObj(this.getUpdaterID()));
    tmpMtmCalendarUserUserActor.setUpdateDate(parseTimestamp(this.getUpdateDate()));
    return tmpMtmCalendarUserUserActor;
  }

  public void setFormData(AbstractBaseObject baseObj) throws ApplicationException {
    MtmCalendarUserUserActor tmpMtmCalendarUserUserActor = (MtmCalendarUserUserActor)baseObj;
    this.setID(TextUtility.formatIntegerObj(tmpMtmCalendarUserUserActor.getID()));
    this.setUserRecordID(TextUtility.formatIntegerObj(tmpMtmCalendarUserUserActor.getUserRecordID()));
    this.setActorType(tmpMtmCalendarUserUserActor.getActorType());
    this.setActorID(TextUtility.formatIntegerObj(tmpMtmCalendarUserUserActor.getActorID()));
    this.setRecordStatus(tmpMtmCalendarUserUserActor.getRecordStatus());
    this.setUpdateCount(TextUtility.formatIntegerObj(tmpMtmCalendarUserUserActor.getUpdateCount()));
    this.setCreatorID(TextUtility.formatIntegerObj(tmpMtmCalendarUserUserActor.getCreatorID()));
    this.setCreateDate(formatTimestamp(tmpMtmCalendarUserUserActor.getCreateDate()));
    this.setUpdaterID(TextUtility.formatIntegerObj(tmpMtmCalendarUserUserActor.getUpdaterID()));
    this.setUpdateDate(formatTimestamp(tmpMtmCalendarUserUserActor.getUpdateDate()));
  }
}
